﻿using Apps.Common;
using Apps.DAL.HC;
using Apps.Models;
using Microsoft.Practices.Unity;
using Remotion.Diagnostics;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Apps.BLL.HC
{
    public partial class HC_EXTEND_FIELD_BLL
    {
        HC_EXTEND_FIELD_Repository dal = new HC_EXTEND_FIELD_Repository();
        HC_FIELD_REFERENCE_VALUE_Repository valueDal = new HC_FIELD_REFERENCE_VALUE_Repository();

        /// <summary>
        /// 扩展列添加
        /// </summary>
        /// <param name="extend_field_model">扩展列实体</param>
        /// <param name="valueList">参考值集合</param>
        /// <returns></returns>
        public bool DoAdd(HC_EXTEND_FIELD extend_field_model, List<HC_FIELD_REFERENCE_VALUE> valueList)
        {
            return dal.DoAdd(extend_field_model, valueList);
        }
        public List<HC_EXTEND_FIELD> GetList()
        {
            return dal.GetList();
        }
        public List<HC_EXTEND_FIELD> GetList(string ids)
        {
            return dal.GetList(ids);
        }
        public List<HC_EXTEND_FIELD> GetList(string queryStr, int pageIndex, int pageSize, string sortFiled, string orderBy, ref int totalCount)
        {
            return dal.GetList(queryStr, pageIndex, pageSize, sortFiled, orderBy, ref totalCount);
        }

        /// <summary>
        /// 扩展列修改
        /// </summary>
        /// <param name="extend_field_model">扩展列实体</param>
        /// <param name="addvalueList">新增参考值集合</param>
        /// <param name="editvalueList">修改参考值集合</param>
        /// <returns></returns>
        public bool DoEdit(HC_EXTEND_FIELD extend_field_model, List<HC_FIELD_REFERENCE_VALUE> addvalueList, List<HC_FIELD_REFERENCE_VALUE> editvalueList)
        {
            return dal.DoEdit(extend_field_model, addvalueList, editvalueList);
        }

        public bool DoDelete(string id)
        {
            return dal.DoDelete(id);
        }

        public bool AddIsRepeated(string filedName)
        {
            return dal.AddIsRepeated(filedName);
        }

        public bool EditIsRepeated(string id, string filedName)
        {
            return dal.EditIsRepeated(id, filedName);
        }

        public HC_EXTEND_FIELD GetById(string id)
        {
            return dal.GetById(id);
        }
        public HC_EXTEND_FIELD_VALUE GetFieldValueById(string fieldId)
        {
            return dal.GetFieldValueById(fieldId);
        }

        public EXTENDFIELD_REFERENCEVALUE GetEntityByID(string extendField)
        {
            return dal.GetEntityByID(extendField);
        }
    }
}
